<template>
  <div class="content wrap">
    <div>
      <ul class="boxs">
        <li v-for="item in data" :key="item.id" @click="toDetail(item.id)">
          <div class="first">
            <img class="img" :src="'http://sc.wolfcode.cn' + item.coverImg" alt="" />
            <img class="set" v-if="item.isLatest" src="../../assets/img/section_new.png" alt="" />
            <img class="set" v-if="item.isHotSale" src="../../assets/img/section_hot.png" alt="" />
          </div>
          <div class="box">
            <p>{{ item.name }}</p>
            <p>{{ item.coin }} <img src="../../assets/img/monad.png" alt="" /></p>
            <button>立即兑换</button>
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>
 
<script>
export default {
  props: ['data'],
  data() {
    return {}
  },
  methods: {
    toDetail(id) {
      console.log(111)
      this.$router.push('/details?id=' + id)
    }
  }
}
</script>
 
<style lang = "less" scoped>
li {
  width: 285px;
  height: 362px;
  cursor: pointer;
  transition: 1s;
  position: relative;
  margin: 15px 0px;
  box-sizing: border-box;
}
.img {
  width: 285px;
  height: 250px;
}
.boxs {
  position: relative;
  display: flex;
  justify-content: space-between;
  width: 1200px;
  flex-wrap: wrap;
  padding: 10px 0px;
  li:hover {
    transform: translateY(-10px);
  }
  button:hover {
    background: red;
  }
  .first {
    .set {
      position: absolute;
      left: 0;
      top: 0;
      width: 58px;
      height: 58px;
      font-size: 16px;
      font-family: SourceHanSansSC;
      font-weight: 400;
      color: #ffffff;
      line-height: 23px;
    }
  }
}
.box {
  width: 285px;
  height: 162px;
  box-sizing: border-box;
  background: pink;
  text-align: center;
  p {
    margin: 10px 0px;
    img {
      width: 20px;
      height: 20px;
    }
  }

  button {
    width: 100px;
    height: 25px;
    font-size: 18px;
    font-family: SourceHanSansSC;
    font-weight: 300;
    color: #0a328e;
    line-height: 23px;
    cursor: pointer;
  }
}
</style>